from apps.catalogue.models import Product
from django.core.management.base import BaseCommand

class Command(BaseCommand):

    def handle(self, *args, **options):
        for prod in Product.objects.all():
            if prod.parent == None: continue

            parent = prod.parent
            prod.title = parent.title + ' ' + prod.size()
            print parent.title + ' ' + prod.size()
            prod.save()

